package com.cash.lemoloan.statisticlib.Utils;


import com.cash.lemoloan.statisticlib.StatisticApplication;
import com.cash.lemoloan.statisticlib.StatisticContant;

import java.util.concurrent.Executors;

public class CommonUtil {
    public static void initGoogleId(){
        try {
            Executors.newSingleThreadExecutor().execute(new Runnable() {
                @Override
                public void run() {
                    try {
                        String advertisingId = AdvertisingIdClient.getGoogleAdId(StatisticApplication.getInstance());
                        StatisticContant.GOOGLEID = advertisingId;
                        PreferencesUtil.putString(StatisticContant.GOOGLEID_KEY,advertisingId);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            });
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
}
